{% extends "base_petadmin.html" %}

{% block mainheading %}Euro conversion list (daily){% endblock %}

{% block object-tools %}

<ul class="object-tools">
    <li><a class="addlink" href="/pet/euroconv/daily/add/">Add</a></li>
    <li><a href="/pet/euroconv/import/daily/">Import file (daily)</a></li>
</ul>

{% endblock %}

{# TODO: Filter by year #}

{% block content %}

    {% include "pet/_links.html" with month_year_link=month_year_link %}

    <table>
        <tr>
            <th>PK</th>
            <th>Date</th>
            <th>EURUSD </th>
            <th>EURJPY </th>
            <th>EURGBP </th>
            <th>EURCHF </th>
            <th>EURAUD </th>
            <th>EURNZD </th>
            <th>EURCAD </th>
            <th>
            </td>
        </tr>

    {% for item in object_list %}
        <tr class="{% cycle "row1" "row2" %}"{% if forloop.last %} style="background-color: lightgreen;" {% endif %}>
            <td>{{ item.pk }}
            <td nowrap>{{ item.date|date:"Y-m-d" }}</td>
            <td>{{ item.EURUSD }}</td>
            <td>{{ item.EURJPY }}</td>
            <td>{{ item.EURGBP }}</td>
            <td>{{ item.EURCHF }}</td>
            <td>{{ item.EURAUD }}</td>
            <td>{{ item.EURNZD }}</td>
            <td>{{ item.EURCAD }}</td>
            <td>
                <a href="/pet/euroconv/daily/{{ item.pk }}/" class="changelink">&nbsp;</a>
                <a href="/pet/euroconv/daily/{{ item.pk }}/delete/" class="deletelink">&nbsp;</a>
            </td>
        </tr>
    {% empty %}
        <tr>
            <td colspan="10">No EUR conversions</td>
        </tr>
    {% endfor %}

        <tr>
            <td colspan="10">
                <input type="button" onclick="window.location='/pet/euroconv/daily/add/'" value="Add" class="default" />
            </td>
        </tr>
    </table>
{% endblock %}
